<template name="html-head">
	<view>
		<view class="titleeee">
			<img class="imglogo" src="../../static/imgs/logozzzz.png"></img>
			<el-input placeholder="请输入关键字" v-model="message" class="input-with-select elinputss">
				<el-button slot="append" type="danger" icon="el-icon-search" @click="notifyParent"></el-button>
			</el-input>
		</view>
		<view class="bodyt1">
			<!-- 			<el-menu :default-active="activeIndex" class="el-menu-demo item" mode="horizontal" @select="handleSelect">
			  <el-menu-item index="1"><span class="tzzz" @click="setActive(0)">首页</span></el-menu-item>
			  <el-submenu index="2">
				<template slot="title"><span class="tzzz">协会概况</span></template>
				<el-menu-item index="2-1"><span class="tzzz">协会简介</span></el-menu-item>
				<el-menu-item index="2-2"><span class="tzzz">组织机构</span></el-menu-item>
				<el-menu-item index="2-3"><span class="tzzz">协会章程</span></el-menu-item>
				<el-menu-item index="2-3"><span class="tzzz">历史沿革</span></el-menu-item>
				<el-menu-item index="2-3"><span class="tzzz">领导关怀</span></el-menu-item>
			  </el-submenu>
			  <el-submenu index="3">
				<template slot="title"><span class="tzzz" @click="setActive(2)">政策法规</span></template>
				<el-menu-item index="3-1"><span class="tzzz">国家政策法规</span></el-menu-item>
				<el-menu-item index="3-2"><span class="tzzz">本省政策法规</span></el-menu-item>
				<el-menu-item index="3-3"><span class="tzzz">外省政策法规</span></el-menu-item>
				<el-menu-item index="3-4"><span class="tzzz">市州政策法规</span></el-menu-item>
			  </el-submenu>
			  <el-submenu index="4">
				<template slot="title"><span class="tzzz" @click="setActive(3)">新闻资讯</span></template>
				<el-menu-item index="4-1"><span class="tzzz">理论研究</span></el-menu-item>
				<el-menu-item index="4-2"><span class="tzzz">民校人物</span></el-menu-item>
				<el-menu-item index="4-3"><span class="tzzz">会员风采</span></el-menu-item>
				<el-menu-item index="4-4"><span class="tzzz">协会文件</span></el-menu-item>
				<el-menu-item index="4-5"><span class="tzzz">资料下载</span></el-menu-item>
			  </el-submenu>
			  <el-submenu index="5">
				<template slot="title"><span class="tzzz">协会活动</span></template>
				<el-menu-item index="5-1"><span class="tzzz">理事年会</span></el-menu-item>
				<el-menu-item index="5-2"><span class="tzzz">调研活动</span></el-menu-item>
				<el-menu-item index="5-3"><span class="tzzz">省际交流</span></el-menu-item>
				<el-menu-item index="5-4"><span class="tzzz">典型推介</span></el-menu-item>
				<el-menu-item index="5-5"><span class="tzzz">协会经验</span></el-menu-item>
			  </el-submenu>
			  <el-submenu index="6">
				<template slot="title"><span class="tzzz">党建工作</span></template>
				<el-menu-item index="6-1"><span class="tzzz">工作动态</span></el-menu-item>
				<el-menu-item index="6-2"><span class="tzzz">经验特色</span></el-menu-item>
			  </el-submenu>
			</el-menu> -->
			<text class="item" @click="setActive(0)">首页</text>
			<el-dropdown class="item" @command="handleCommandA">
				<span class="el-dropdown-link tzzz">
					协会概况<i class="el-icon-arrow-down el-icon--right"></i>
				</span>
				<el-dropdown-menu slot="dropdown">
					<el-dropdown-item command="1">协会简介</el-dropdown-item>
					<el-dropdown-item command="2">组织机构</el-dropdown-item>
					<el-dropdown-item command="3">协会章程</el-dropdown-item>
					<el-dropdown-item command="4">历史沿革</el-dropdown-item>
					<el-dropdown-item command="5">领导关怀</el-dropdown-item>
				</el-dropdown-menu>
			</el-dropdown>
			<el-dropdown class="item" @command="handleCommandB">
				<span @click="setActive(2)" class="el-dropdown-link">
					政策法规<i class="el-icon-arrow-down el-icon--right"></i>
				</span>
				<el-dropdown-menu slot="dropdown">
					<el-dropdown-item command="2">国家政策法规</el-dropdown-item>
					<el-dropdown-item command="3">本省政策法规</el-dropdown-item>
					<el-dropdown-item command="4">外省政策法规</el-dropdown-item>
					<el-dropdown-item command="5">市州政策法规</el-dropdown-item>
				</el-dropdown-menu>
			</el-dropdown>
			<el-dropdown class="item" @command="handleCommandC">
				<span @click="setActive(3)" class="el-dropdown-link">
					新闻资讯<i class="el-icon-arrow-down el-icon--right"></i>
				</span>
				<el-dropdown-menu slot="dropdown">
					<el-dropdown-item command="2">理论研究</el-dropdown-item>
					<el-dropdown-item command="3">民校人物</el-dropdown-item>
					<el-dropdown-item command="4">会员风采</el-dropdown-item>
					<el-dropdown-item command="5">协会文件</el-dropdown-item>
					<el-dropdown-item command="6">资料下载</el-dropdown-item>
				</el-dropdown-menu>
			</el-dropdown>
			<el-dropdown class="item" @command="handleCommandD">
				<span @click="setActive(5)" class="el-dropdown-link">
					协会活动<i class="el-icon-arrow-down el-icon--right"></i>
				</span>
				<el-dropdown-menu slot="dropdown">
					<el-dropdown-item command="1">理事年会</el-dropdown-item>
					<el-dropdown-item command="2">调研活动</el-dropdown-item>
					<el-dropdown-item command="3">省际交流</el-dropdown-item>
					<el-dropdown-item command="4">典型推介</el-dropdown-item>
					<el-dropdown-item command="5">协会经验</el-dropdown-item>
				</el-dropdown-menu>
			</el-dropdown>
			<el-dropdown class="item" @command="handleCommandF">
				<span @click="setActive(10)" class="el-dropdown-link">
					党建工作<i class="el-icon-arrow-down el-icon--right"></i>
				</span>
				<el-dropdown-menu slot="dropdown">
					<el-dropdown-item command="1">工作动态</el-dropdown-item>
					<el-dropdown-item command="2">经验特色</el-dropdown-item>
				</el-dropdown-menu>
			</el-dropdown>
		</view>
	</view>
</template>
<script>
	export default {
		foot: "html-head",
		data() {
			return {
				options: {},
				visible: false,
				message: '',
				items: [
					//{ name: '首页' },  
					//{ name: '协会概况' },  
					//{ name: '政策法规' }, 
					//{ name: '新闻资讯' },
					//{ name: '理论研究' }, 
					//{ name: '协会活动' },
					//{ name: '民校人物' }, 
					//{ name: '会员风采' },
					//{ name: '协会文件' },
					//{ name: '资料下载' }, 
					//{ name: '党建工作' }
				],
				activeIndex: null,
				activeIndex2: null
			}
		},
		async onLoad(options = {}) {
			vk = uni.vk;
			this.options = options;
		},
		props: {
			indexdata: {
				type: Number,
				default: '' // 如果父组件没有提供该 prop，可以设置一个默认值  
			}
		},
		methods: {
			handleSelect(key, keyPath) {
				console.log(key);
				//console.log(keyPath);
			},
			notifyParent() {
				if (this.message) {
					//console.log(this.message)
					vk.navigateTo('/pages/modo/wzss?message=' + this.message);
				} else {
					this.$message({
						message: '关键字为空',
						type: 'warning'
					});
				}

			},
			isActive(index) {
				return this.activeIndex2 === index;
			},
			handleCommandA(command) {
				//this.$message('click on item ' + command);
				if (command == 1) {
					vk.navigateTo('/pages/modo/xhjj?tempdata=xhjj');
				} else if (command == 2) {
					vk.navigateTo('/pages/modo/xhjj?tempdata=zzjg');
				} else if (command == 3) {
					vk.navigateTo('/pages/modo/xhjj?tempdata=xhzc');
				} else if (command == 4) {
					vk.navigateTo('/pages/modo/xhjj?tempdata=lsyg');
				} else if (command == 5) {
					vk.navigateTo('/pages/modo/xhjj?tempdata=ldgh');
				}

			},
			handleCommandB(command) {
				//this.$message('click on item ' + command);
				if (command == 1) {
					vk.navigateTo('/pages/modo/modo?tempdata=zcfg');
				} else if (command == 2) {
					vk.navigateTo('/pages/modo/modo?tempdata=gjzcfg');
				} else if (command == 3) {
					vk.navigateTo('/pages/modo/modo?tempdata=bszcfg');
				} else if (command == 4) {
					vk.navigateTo('/pages/modo/modo?tempdata=wszcfg');
				} else if (command == 5) {
					vk.navigateTo('/pages/modo/modo?tempdata=szzcfg');
				}
			},
			handleCommandC(command) {
				//this.$message('click on item ' + command);
				if (command == 2) {
					vk.navigateTo('/pages/modo/xwzx?tempdata=llyj');
				} else if (command == 3) {
					vk.navigateTo('/pages/modo/xwzx?tempdata=mxrw');
				} else if (command == 4) {
					vk.navigateTo('/pages/modo/xwzx?tempdata=hyfc');
				} else if (command == 5) {
					vk.navigateTo('/pages/modo/xwzx?tempdata=xhwj');
				} else if (command == 6) {
					vk.navigateTo('/pages/modo/xwzx?tempdata=zlxz');
				}
			},
			handleCommandD(command) {
				//this.$message('click on item ' + command);
				if (command == 1) {
					vk.navigateTo('/pages/modo/xhhd?tempdata=xhhd-lsnh');
				} else if (command == 2) {
					vk.navigateTo('/pages/modo/xhhd?tempdata=xhhd-dyhd');
				} else if (command == 3) {
					vk.navigateTo('/pages/modo/xhhd?tempdata=xhhd-sjjl');
				} else if (command == 4) {
					vk.navigateTo('/pages/modo/xhhd?tempdata=xhhd-jxtj');
				} else if (command == 5) {
					vk.navigateTo('/pages/modo/xhhd?tempdata=xhhd-xhjy');
				}
			},
			handleCommandF(command) {
				//this.$message('click on item ' + command);
				if (command == 1) {
					vk.navigateTo('/pages/modo/djgz?tempdata=djgz-gzdt');
				} else if (command == 2) {
					vk.navigateTo('/pages/modo/djgz?tempdata=djgz-jyts');
				}
			},
			setActive(index) {
				vk.pubfn.debounce(() => {
					this.activeIndex2 = index;
					// 设置当前激活元素的索引  
					if (index == 0) {
						//
						vk.navigateTo('/pages/index/index');
					} else if (index == 1) {
						//
						vk.navigateTo('/pages/modo/xhjj?tempdata=xhjj');
					} else if (index == 2) {
						//
						vk.navigateTo('/pages/modo/modo?tempdata=zcfg');
					} else if (index == 3) {
						//
						vk.navigateTo('/pages/modo/xwzx?tempdata=xwzx');
					} else if (index == 4) {
						vk.navigateTo('/pages/modo/xwzx?tempdata=llyj');
					} else if (index == 5) {
						vk.navigateTo('/pages/modo/xhhd?tempdata=xhhd');
					} else if (index == 6) {
						vk.navigateTo('/pages/modo/xwzx?tempdata=mxrw');
					} else if (index == 7) {
						vk.navigateTo('/pages/modo/xwzx?tempdata=hyfc');
					} else if (index == 8) {
						vk.navigateTo('/pages/modo/xwzx?tempdata=xhwj');
					} else if (index == 9) {
						vk.navigateTo('/pages/modo/xwzx?tempdata=zlxz');
					} else if (index == 10) {
						vk.navigateTo('/pages/modo/djgz?tempdata=djgz');
					}
				}, 1000);

			},
			submit() {
				uni.showModal({
					content: "hello uni-app开源地址为https://github.com/dcloudio/uni-app/tree/master/examples，请在这个开源项目上贡献你的代码",
					showCancel: false
				})
			}
		}
	}
</script>
<style scoped>
	.el-input-group__append .el-button,
	.el-input-group__append .el-select,
	.el-input-group__prepend .el-button,
	.el-input-group__prepend .el-select {
		display: inline-block;
		margin: -10px -21px;
	}

	.tzzz {
		cursor: pointer;
		font-size: 18px;
	}

	.tzzz:hover {
		color: #ba1c1b;
	}

	.item {
		position: relative;
		left: 370px;
		top: 18px;
		margin-left: 30px;
		color: grey;
		transition: color 0.3s ease;
		font-size: 18px;
	}


	.item:hover {
		color: #ba1c1b;
	}

	.elinputss {
		width: 300px;
		left: 580px;
		bottom: 30px;
		position: relative;
	}

	/* 	.item.active {  
		color: #ba1c1b; 
	   激活状态的额外样式
	}  */
	.itemactive {
		color: #ba1c1b;
		/* 或者你想要的任何颜色 */
	}

	text {
		cursor: pointer;
	}

	.imglogo {
		width: 500px;
		height: 100px;
		left: 380px;
		top: 10px;
		position: relative;
	}

	.titleeee {
		background-color: #ba1c1b;
		width: 2000px;
		height: 130px;
	}

	.bodyt1 {
		background-color: white;
		width: 1800px;
		height: 60px;
	}
</style>